<!--
 * @Author: yankun2000 yankun@powerpms.com
 * @Date: 2024-05-16 10:09:30
 * @LastEditors: yankun2000 yankun@powerpms.com
 * @LastEditTime: 2024-05-16 10:11:48
 * @FilePath: \vue3-element-admin\src\views\demo\curd\watchPractice.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    <div>
      {{ message }}
      <Button @click="changeMessage">改变message</Button>
    </div>
  </div>
</template>

<script lang="ts">
export default {
  setup() {
    const message = ref('我是谁呢')
    const changeMessage = () => {
      message.value = '我是闫坤'
    }
    watch(message, (oldValue, newValue) => {
      console.log(oldValue, newValue);

    })
    return {
      message, changeMessage
    };
  },
};
</script>

<style lang="scss" scoped></style>
